package cate.game.role.farm.udgpalace.msg;

import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBUdgPalace;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "地宫探险使用道具的请求")
public class UdgPalaceUseItemReq implements MsgInput {
    @NoteField("使用的道具栏ID")
    public int itemId;
    @NoteField("bossid，使用刺杀道具要传")
    public int bossId;
    @NoteField("食灵uid，当使用回血和加属性道具要传")
    public String heroUid;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = cc.getRole().getFarm().udgPalace.useItem(itemId, heroUid, bossId);
        game.notice.message(cc.getRole(), r, true);
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBUdgPalace.USE_ITEM_REQ;
    }
}
